# -*- coding: utf-8 -*-  
'''
原始数据

@author: luoyi
Created on 2021年4月7日
'''
#    读取对联
def read_couplet_iterator(in_path, 
                          out_path,
                          count=10000):
    in_fr = open(file=in_path, mode='r', encoding='utf-8')
    out_fr = open(file=out_path, mode='r', encoding='utf-8')
    
    i = 0
    while (count < 0 or i < count):
        i += 1
        
        in_line = in_fr.readline()
        if (in_line == ''): break
        in_line = in_line.split(' ')[:-1]           #    去掉末尾的\n
        
        out_line = out_fr.readline()
        if (out_line == ''): break
        out_line = out_line.split(' ')[:-1]         #    去掉末尾的\n
        
        yield in_line, out_line
        pass
    
    in_fr.close()
    out_fr.close()
    pass